﻿// -----------------------------------------------------------------------
// <copyright file="RegexValidation.cs" company="Infolyzer">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Cms.Utilities
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.RegularExpressions;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class RegexValidation
    {
        public static bool NameIsFileSystemCompliant(string name)
        {
            // Allow characters a-z, A-Z, 0-9, hyphen, underscore and punct. 
            return Regex.IsMatch(name, @"^[a-zA-Z0-9-_\\.]+?$");
        }
    }
}
